package com.moyq5.permit.center.feign.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.moyq5.mvc.framework.general.Body;
import com.moyq5.mvc.framework.general.PageData;
import com.moyq5.mvc.framework.general.Sorting;
import com.moyq5.mvc.framework.jackson.result.ListResult;
import com.moyq5.mvc.framework.jackson.result.ObjectResult;
import com.moyq5.mvc.framework.jackson.result.PageResult;
import com.moyq5.mvc.framework.jackson.result.StatusResult;
import com.moyq5.permit.center.bean.entity.ShopRole;
import com.moyq5.permit.center.bean.search.ShopRole4Search;
import com.moyq5.permit.center.bean.embed.ShopRoleId;

/**
 * @author Moyq5’s Tools
 * @since 2019-07-25 11:58:13
 */
@FeignClient(name="feign-server", url="${feign.server.url}")
@RequestMapping("/feign/shopRole")
public interface ShopRoleFeign {

	@PostMapping("/oneById?filter=")
	@ResponseBody
	ObjectResult<ShopRole> one(ShopRoleId id);
	
	@PostMapping("/count")
	@ResponseBody
	ObjectResult<Long> count(Body<ShopRole4Search, String> shopRole4s);
	
	@PostMapping("/one?filter=")
	@ResponseBody
	ObjectResult<ShopRole> one(Body<ShopRole4Search, Sorting> shopRole4s);
	
	@PostMapping("/list?filter=")
	@ResponseBody
	ListResult<ShopRole> list(Body<ShopRole4Search, Sorting> shopRole4s);

	@PostMapping("/page?filter=")
	@ResponseBody
	PageResult<ShopRole> page(Body<ShopRole4Search, PageData> shopRole4s);

	@PostMapping("/page?filter=role")
	@ResponseBody
	PageResult<ShopRole> pageWithRole(Body<ShopRole4Search, PageData> shopRole4s);

	@PostMapping("/page?filter=shopAndRole")
	@ResponseBody
	PageResult<ShopRole> pageWithShopAndRole(Body<ShopRole4Search, PageData> shopRole4s);

	@PutMapping
	@ResponseBody
	ObjectResult<ShopRoleId> create(ShopRole shopRole);
	
	@PatchMapping
	@ResponseBody
	StatusResult update(ShopRole shopRole);
	
	@DeleteMapping
	@ResponseBody
	StatusResult remove(ShopRoleId id);

}
